package com.ysd.lis.controller.lab;


import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.lab.LabChannel;
import com.ysd.lis.entity.lab.LabItemDictRefer;
import com.ysd.lis.service.lab.LabChannelService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 通道号管理表 前端控制器
 * </p>
 *
 * @author Bai
 * @since 2024-01-26
 */
@RestController
@RequestMapping("/lab/channel")
public class LabChannelController extends BaseController {
    @Autowired
    LabChannelService channelService;
    //获取通道号列表信息
    @ApiOperation("获取通道号信息")
    @GetMapping("/findChannelList")
    public Result findChannelList(LabChannel labChannel) {
        return channelService.findChannelList(labChannel);
    }

    @ApiOperation("添加通道号")
    @PostMapping("/addLabChannel")
    @LogDetail(requestParam ="addLabChannel",operationType = OperationType.INSERT, module = "检验管理" , businessName = "channelCode",content = "新增【channelCode】通道号操作")
    public Result addLabChannel(@RequestBody LabChannel labChannel){
        return channelService.addLabChannel(labChannel);
    }

    @ApiOperation("修改参考范围")
    @PostMapping("/editLabChannel")
    @LogDetail(requestParam ="editLabChannel",operationType = OperationType.UPDATE, module = "检验管理", businessName = "channelCode", content = "修改【channelCode】通道号操作")
    public Result editLabChannel(@RequestBody LabChannel labChannel){
        return channelService.editLabChannel(labChannel);
    }

    @ApiOperation("修改双工")
    @PostMapping("/editLabChannelOpen")
    @LogDetail(requestParam ="editLabChannelOpen",operationType = OperationType.UPDATE, module = "检验管理", businessName = "channelCode", content = "修改【channelCode】通道号操作")
    public Result editLabChannelOpen(@RequestBody LabChannel labChannel){
        return channelService.editLabChannelOpen(labChannel);
    }

    @ApiOperation("删除参考范围")
    @PostMapping("/deleteChanne")
    @LogDetail(requestParam ="deleteChanne",operationType = OperationType.UPDATE, module = "检验管理", businessName = "channelCode", content = "修改【channelCode】通道号操作")
    public Result deleteChanne(@RequestBody  LabChannel labChannel){
        return channelService.deleteChanne(labChannel);
    }

}
